<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定定位</title>
    <style>

        .div01 {
            position: relative;
            z-index: 1;
        }

        .child01 {
            height: 200px;
            width: 200px;
            border: 1px solid red;
            background-color: blue;
            position: relative;
        }

        .child02 {
            height: 200px;
            width: 200px;
            background-color: green;
            position: relative;
            top: -200px;
        }

        .div02 {
            position: relative;
            z-index: -1;
        }

    </style>
</head>
<body>
    <div class="div01">
        <div class="child01"></div>
       <!-- <div class="child02"></div>-->
    </div>
    <div class="div02">
        <div class="child02"></div>
    </div>
</body>
</html>